<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\Route;

// 后台路由
Route::get('admin','admin/Index/index');
Route::get('indexpage','admin/Index/indexPage');
//登录路由
Route::get('login','admin/Login/index');
Route::post('login','admin/Login/doLogin');

//登出路由
Route::get('loginout','admin/Login/loginOut');
//验证码
Route::get('Verify','admin/Login/checkVerify');
//管理员管理
Route::get('user','admin/User/index');
Route::any('useradd','admin/User/userAdd');
Route::get('userEdit/:id','admin/User/userEdit');
Route::post('douserEdit','admin/User/userEdit');
Route::get('userDel','admin/User/userDel');


//角色管理
Route::get('role','admin/Role/index');
Route::any('roleadd','admin/Role/roleAdd');
Route::get('roleedit/:id','admin/Role/roleEdit');
Route::post('doroleedit','admin/Role/roleEdit');
Route::get('roledel','admin/Role/roleDel');
Route::any('giveAccess','admin/Role/giveAccess');
//节点管理
Route::get('node','admin/Node/index');
Route::any('nodeadd','admin/Node/nodeAdd');
Route::post('nodeedit','admin/Node/nodeEdit');
Route::get('nodedel','admin/Node/nodeDel');

//数据备份还原
Route::get('datasql','admin/Data/index');
Route::any('savesql','admin/Data/importData');
Route::get('backsql','admin/Data/backData');

//文章管理
Route::get('articles','admin/Articles/index');
Route::any('articlesadd','admin/Articles/articleAdd');
Route::post('uploadimg','admin/Articles/uploadImg');
Route::get('articlesedit/:id','admin/Articles/articleEdit');
Route::post('doarticlesedit','admin/Articles/articleEdit');
Route::get('articlesdel','admin/Articles/articleDel');
Route::post('uploadImg','admin/Articles/uploadImg');


//分类管理
Route::get('category','admin/Category/index');
Route::any('addcate','admin/Category/cateAdd');
Route::get('editcate/:id','admin/Category/cateEdit');
Route::post('doeditcate','admin/Category/cateEdit');
Route::get('cateDel','admin/Category/cateDel');
Route::get('catechildAdd/:id','admin/Category/catechildAdd');
Route::post('docatechildAdd','admin/Category/catechildAdd');
Route::get('catechild/:id','admin/Category/cateChild');
Route::get('catechildDel','admin/Category/cateChildDel');
Route::get('catechildEdit/:id','admin/Category/cateChildEdit');

//Route::get('/123','index/Index/index');
// 404 页面
//Route::miss('admin/Miss/miss');
Route::get('/','index/Index/index');





























return [
    '__pattern__' => [
        'name' => '\w+',
    ],
    '[hello]'     => [
        ':id'   => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
        ':name' => ['index/hello', ['method' => 'post']],
    ],

];
